package com.yang.action;

import com.yang.service.OrdersService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet("/OrdersDeleteById")
public class OrdersDeleteByIdAction extends HttpServlet {
    OrdersService ordersService = new OrdersService();

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String id = req.getParameter("id");
        int num = ordersService.deleteOrdersById(id);
        resp.setContentType("text/text;charset=utf-8");
        PrintWriter out = resp.getWriter();
        out.print(num);
        out.flush();
        out.close();
    }
}

